const path = require("path");
const {
    nextTick
} = require("process");
//  停用
// const loginCheckContorller = require("../controller/loginCheckController"); // 导入登录状态检查

//----------首页
const indexController = (req, res) => {
    res.sendFile(path.join(process.cwd(), "dist/views", "index.html"));
    //     res.sendFile(path.join(process.cwd(), "src/views", "index.html"));
};

//新增定制项目核价项目
const addDesignerController = (req, res) => {
    res.sendFile(path.join(process.cwd(), "dist/views", "addDesigner.html"));
    //   res.sendFile(path.join(process.cwd(), "src/views", "addDesigner.html"));
};

//修改项目页面
const edithController = (req, res) => {
    res.sendFile(path.join(process.cwd(), "dist/views", "update.html"));
    //   res.sendFile(path.join(process.cwd(), "src/views", "update.html"));
};

//客户端请求获取查询页面及数据
const toViewController = (req, res) => {
    res.sendFile(path.join(process.cwd(), "dist/views", "toview.html"));
    // res.sendFile(path.join(process.cwd(), "src/views", "toview.html"));
};

// 登陆  注意这是手动访问时已登陆状态下的路由，否则会被登陆检查拦截，
const loginController = (req, res) => {
    res.sendFile(path.join(process.cwd(), "dist/views", "userlogin.html"));
    // res.sendFile(path.join(process.cwd(), "src/views", "userlogin.html"));
};
// 修改账户密码页面
const changePasswd = (req, res) => {
    res.sendFile(path.join(process.cwd(), "dist/views", "changePasswd.html"));
    //   res.sendFile(path.join(process.cwd(), "src/views", "changePasswd.html"));
};

//添加新项目页面  暂时作废
const serverController = (req, res) => {
    // res.sendFile(path.join(process.cwd(), "dist/views", "add.html"));
};

module.exports = {
    indexController,
    serverController,
    edithController,
    loginController,
    changePasswd,
    toViewController,
    addDesignerController,
};